package org.example.RabbitListener;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class SpringRabbitListener 
{
	@RabbitListener(queues = {"direct.queue1"})
	public void listener1(String mes) throws InterruptedException {
		System.out.println("消费者1接受消息："+mes);
	}
	
	@RabbitListener(queues = {"direct.queue2"})
	public void listener2(String mes) throws InterruptedException 
	{
		System.out.println("消费者2接受消息："+mes);
	}
}
